<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<!-- 微信工具包：全屏等 -->
<script type="text/javascript" src="<%=request.getContextPath()%>/m/js/wx.util.js"></script>
<script type="text/javascript">
	//"http://localhost:8080/timefurniture/cart"
	var prePath = window.document.location.href; 
	
	//获取主机地址之后的目录，如： "/timefurniture/cart"
	var pathName = window.document.location.pathname; 
	
	//获取主机地址
	var pos = prePath.indexOf(pathName); //21
	//获取带"/"的项目名，如："http://localhost:8080"
	var localhostPath = prePath.substring(0, pos);
	
	//项目名，如："/timefurniture"
	var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
	
	//完整项目路径，如："http://localhost:8080/timefurniture"
	rootPath = localhostPath + projectName;
	
	$(function(){
		if($.cart.length()>0){
			$("#cart_tip").addClass("cart_n");
		}else{
			$("#cart_tip").removeClass("cart_n");
		}
	});
</script>
<script type="text/javascript">
	function userInfo(cid){
		var userId = '${sessionScope.user.id}';
		//var cid = '${cid}';
		if(null == userId || userId == ''|| userId == 'null'){
			location.href = rootPath + "/user/login?cid="+cid;
		}else{
			location.href = rootPath + "/user/backend?cid="+cid;//+"&userId="+userId
		}
	}
</script>
<script type="text/javascript">
	function openWin(cid){
		//$("#showMessage").show();
		//OpenWindow=window.open("", "newwin", "height=50, width=50,toolbar=no,scrollbars="+scroll+",menubar=no");
		//alert(12);
	}
</script>
<script type="text/javascript">
var append = "cid=${loginId}";
$.each($('a'), function(i,val){
	if(typeof(val.href)!="undefined") {
		if(val.href.indexOf('javascript')!=-1)
			return;
		if(val.href.indexOf('cid=')!=-1)
			return;
		var reg=new RegExp("#$");     
	    if(reg.test(val.href))     
			return;
	    reg=new RegExp("^tel:");     
	    if(reg.test(val.href))     
			return;
		var oldUrl = val.href;
		var newUrl = oldUrl;
		var position = oldUrl.indexOf("?");
		if(position==-1) {
			newUrl = oldUrl+"?"+append;
		} else {
			newUrl = oldUrl+"&"+append;
		}
		val.href=newUrl;
	}
});   
</script>
<style type="text/css">
.themeStyle{background: #bb5536;}
/*.plug-div {
	display:none;
	position:fixed;
	bottom:50%;
	text-align : center;
	left:8%;
	z-index:900;
}*/
.plug-div{
	display:none;
	text-align : center;
	position:fixed;/**绝对定位**/
	left:50%;/**左边50%**/
	top:50%;/**顶部50%**/
	margin-top:-30px;/**上移-50%**/
	margin-left:-135px;/**左移-50%**/
	z-index:900;
}


.plug-menu {
	width:240px;
	height:50px;
	/*border-radius:36px;圆角边框*/
	position: absolute;
	bottom:16px;
	left: 16px;
	z-index:999;
	/*-moz-box-shadow:0 0 0 4px #c4745b, 0 2px 5px 4px rgba(0, 0, 0, 0.25);
	-webkit-box-shadow:0 0 0 4px #c4745b, 0 2px 5px 4px rgba(0, 0, 0, 0.25);
	box-shadow:0 0 0 4px #c4745b, 0 2px 5px 4px rgba(0, 0, 0, 0.25);*/
	background-color: #bb5536;
	background: #bb5536;
}

.plug-menu img{
	width: 100%;
}
.plug-menu a{
	text-decoration:none;
	font-color : #fff;
	text-align : center;
}
.menu_top {
	margin : 0px auto;
	position : relative;
	background-color: #940000;
	background: #940000;
	vertical-align : 100px;
	line-height : 10px;
}
.menu_down {
	margin : 0 0 0 0;
	position : relative;
	background-color: #c78f8e;
	background: #c78f8e;
}
</style>
<script type="text/javascript">

function openMenu(){
	if($(".plug-div").is(":visible") == false){
		$(".plug-div").show();
		return;
	}
}
</script>
<!-- <img src="<%=request.getContextPath()%>/m/images/footer_changehome0.png"> 
<img src="<%=request.getContextPath()%>/m/images/footer_changehome1.png">
<img src="<%=request.getContextPath()%>/m/images/footer_changehome2.png">
  -->
<link href="<%=request.getContextPath()%>/m/css/footer.css" rel="stylesheet" />
<footer>
	<div class="plug-div">
            <div class="plug-menu themeStyle">
            	<div class="menu_top">
	            	<img src="<%=request.getContextPath()%>/m/images/footer_changehome0.png">	
            	</div>            
            	<div class="menu_down">
	            	<a href="javascript:" onclick="window.location.href=rootPath+'/rcategory?cid=<%=request.getAttribute("loginId") %>'">
	            		<img src="<%=request.getContextPath()%>/m/images/footer_changehome1.png">
	            	</a>            		
            	</div>
            	<div class="menu_top">
	            	<a href="javascript:" onclick="window.location.href=rootPath+'/category?cid=<%=request.getAttribute("loginId") %>'">
	            		<img src="<%=request.getContextPath()%>/m/images/footer_changehome2.png">
	            	</a>  	
            	</div>

            </div>
	</div>

 	<div id="footer_nav">
		<div class="left">
			<ul>
				<li>
					<a href="javascript:history.go(-1)"><img 
						src="<%=request.getContextPath()%>/m/images/pre.png"></a>
				</li>
				<li>
					<!-- <a href="javascript:" onclick="window.location.href=rootPath+'/category'">
					<a href="javascript:" onclick = "openWin(<%=request.getAttribute("loginId") %>)"> -->
					<a href="javascript:" onclick="openMenu()">
					<img src="<%=request.getContextPath()%>/m/images/home.png"></a>
				</li>
				<!--li>
					<a href="javascript:history.go(1)"><img 
						src="<%=request.getContextPath()%>/m/images/next.png"></a>
				</li> doyle-->
			</ul>
		</div>
		<div class="center">
	     	<ul>
				<li>
					<a href="javascript:" onclick = "userInfo(<%=request.getAttribute("loginId") %>)">
						<img src="<%=request.getContextPath()%>/m/images/user.png">
					</a> 
				</li>
	        </ul>
       </div>
		<div class="right">
			<ul>
        		<li>
        			<a href="javascript:" onclick = "window.location.href=rootPath+'/cart?cid=<%=request.getAttribute("loginId") %>'">
        				<img src="<%=request.getContextPath()%>/m/images/cart.png">
       				</a>
        		</li>
			</ul>
		</div>       
	</div>
</footer>

<div id="showMessage" style="display:none; position:relative; left:30%; top:30%">
	<div style="width:50px; height:50px; background-color:#fff">
		
	</div>
</div>
<!-- 

					<a href="javascript:" onclick = "window.location.href=rootPath+'/user/backend?cid=<%=request.getAttribute("loginId") %>'">
						<img src="<%=request.getContextPath()%>/m/images/user.png">
					</a> 
 -->